<?php
namespace core\tpl;


class PhpTpl extends BaseTpl  {
    public function import($tpl) {
        $filename = $tpl ?: CONTROLLER . '/' . METHOD . '.html.php';
        $filename = $this->_tplDir . $filename;

        if (!file_exists($filename)) {
            echo '<strong style="color:#F30">Can\'t find Template:' . $tpl . '</strong>';
            exit();
        }

        extract($this->_tplData);
        /** @noinspection PhpIncludeInspection */
        require_once $filename;
    }
}
